package tongcheng.com.tongcheng.ui.yemian.shenfen.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.ButterKnife;
import tongcheng.com.tongcheng.R;
import tongcheng.com.tongcheng.base.BaseActivity;
import tongcheng.com.tongcheng.utils.Setting;

public class SendOrderActivity extends BaseActivity {

    @Bind(R.id.shenfen_title)
    TextView mShenfenTitle;
    @Bind(R.id.sendorder_qiye)
    Button mSendorderQiye;
    @Bind(R.id.sendorder_geren)
    Button mSendorderGeren;
    @Bind(R.id.back)
    ImageView mBack;


    @Override
    public Integer initResid() {
        return R.layout.activity_send_order;
    }

    @Override
    public void initCreate(Bundle savedInstanceState) {
        mSendorderGeren.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startactivity(SendOrderActivity.this, WanShanZiLiaoActivity.class);
                Setting.setShenfen(2);
               /* MyRequest request = new MyRequest(ConStans.UpShenfen_Url, RequestMethod.POST);
                request.add("type", 2);
                request.add("phone", Setting.getPhone());
                CallServer.getInstance().  addPost(request, 1, new OnCallBack() {
                    @Override
                    public void OnSuccess(int what, String json, Object ject) {
                        StatusBean statusBean = GsonUtil.GsonToBean(json, StatusBean.class);
                        if (statusBean != null) {
                            if (statusBean.msg != null) {
                                ShowToast.showToast(statusBean.msg);
                            }
                            if (statusBean.status == 1) {
                                startactivity(SendOrderActivity.this, WanShanZiLiaoActivity.class);
                            }
                        }
                    }
                });*/
            }
        });


        mSendorderQiye.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startactivity(SendOrderActivity.this, WanShanZiliao_Qiye_qiyeActivity.class);
                Setting.setShenfen(1);
               /* MyRequest request = new MyRequest(ConStans.UpShenfen_Url, RequestMethod.POST);
                request.add("type", 1);
                request.add("phone", Setting.getPhone());
                 CallServer.getInstance().  addPost(request, 1, new OnCallBack() {
                    @Override
                    public void OnSuccess(int what, String json, Object ject) {
                        StatusBean statusBean = GsonUtil.GsonToBean(json, StatusBean.class);
                        if (statusBean != null) {
                            if (statusBean.msg != null) {
                                ShowToast.showToast(statusBean.msg);
                            }
                            if (statusBean.status == 1) {
                                startactivity(SendOrderActivity.this, WanShanZiliao_QiyeActivity.class);
                            }
                        }
                    }
                });*/

            }
        });


        mBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
